# -*- coding: utf-8 -*-

from google.appengine.api.urlfetch import fetch as fc

def index():
    " my_sip by MySip class "
    my_sip = MySip()

    query_url = my_sip.get_url('query_keys')
    query_result = fetch(query_url)
    query_headers = fc(query_url).headers

    isLogin_url = my_sip.get_url('isLogin_keys')
    isLogin_headers = fc(isLogin_url).headers
    isLogin_result = fetch(isLogin_url)

    unbind_url = my_sip.get_url('unbind_keys')
    unbind = A('unbind', _href=unbind_url)

    return dict(
        query_url = query_url,
        query_result = query_result,
        query_headers = query_headers,

        isLogin_url = isLogin_url,
        isLogin_result = isLogin_result,
        isLogin_headers = isLogin_headers,

        unbind = unbind,
        )

def sip_server():
    x = sip.check_session()
    return dict(x = x)